/* eslint-disable @typescript-eslint/no-explicit-any */
import { post, customError } from '../index';
import { PageResponse, ReturnType, TeamDetailRequest, TeamDetailResponse, TeamResponse } from '../interface'
import { URL_TEAM, URL_TEAM_DETAIL } from '../base/url'

export const teamBaseInfo = async (): Promise<ReturnType<TeamResponse | undefined>> => {
    try {
        const result = await post<TeamResponse>(URL_TEAM)
        return result
    } catch (error: any) {
        return customError(error)
    }
}


export const teamDetail = async (params: TeamDetailRequest): Promise<ReturnType<PageResponse<TeamDetailResponse> | undefined>> => {
    try {
        const result = await post<PageResponse<TeamDetailResponse>>(URL_TEAM_DETAIL, params);
        return result;
    } catch (error: any) {
        return customError(error)
    }
}